/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package text_classification;

/**
 *
 * @author robertgunawan
 */
public class class_value {
    private int negatif;
    private int positif;
    private int netral;
    private int total;

    public class_value()
    //ini bakal pakai laplacian correction
    {
        negatif = 1;
        positif = 1;
        netral = 1;
        total = 3;
    }

    public class_value(boolean isLaplace)
    {
        if(isLaplace)
        {
            negatif = 1;
            positif = 1;
            netral = 1;
            total = 3;
        }
        else
        {
            negatif = 0;
            positif = 0;
            netral = 0;
            total = 0;
        }
    }

    //getter
    public int getNegatif()
    {
        return negatif;
    }

    public int getPositif()
    {
        return positif;
    }

    public int getNetral()
    {
        return netral;
    }

    public int getTotal()
    {
        return total;
    }

    //setter
    public void setNegatif(int value)
    {
        negatif = value;
    }

    public void setPositif(int value)
    {
        positif = value;
    }

    public void setNetral(int value)
    {
        netral = value;
    }

    public void setTotal(int value)
    {
        total = value;
    }

    public void increment(boolean isNegatif, boolean isPositif, boolean isNetral)
    {
        if(isNegatif)
        {
            negatif++;
            total++;
        }
        else if(isPositif)
        {
            positif++;
            total++;
        }
        else if(isNetral)
        {
            netral++;
            total++;
        }
    }

    public void increment(char field)
    {
        if(field == '-')
        {
            negatif++;
            total++;
        }
        else if(field == '+')
        {
            positif++;
            total++;
        }
        else if(field == '#')
        {
            netral++;
            total++;
        }
    }
}
